package java_常用api;

public class API_6_递归 {
    public static void main(String[] args) {
        int i = 0;
        int sum = getsum(100);
        System.out.println(sum);
    }

    private static int getsum(int i) {
        if (i ==1){
            return 1;
        }else {
            return i+getsum(i-1);
        }
    }
}
